package com.uni.controllers.editors;

import java.beans.PropertyEditorSupport;
import java.util.Date;

import com.DateParser;

public class DateEditor extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        Date d = DateParser.parse(text);
        if(d != null){
            setValue(d);
        } else {
        	System.out.println("Date is " + d);
        	throw new IllegalArgumentException(); 
        }
    }
}
